import axios from 'axios';
import {HttpParamsEntity} from "./http-params.entity";


export const request = (params: HttpParamsEntity): Promise<any> => {
    return new Promise((resolve, reject) => {
        axios({
            method: params.method,
            url: 'http://localhost:8001' + params.url,
            params: params.data
        }).then((response: any) => {
            resolve(response.data);
        }).catch((error: any) => {
            reject(error);
        });
    });
}